/*
$(function(){
    $('#contact').submit(function() {
        doValidation();
        return false;
    }
});
*/
function doValidation()
{
    var url = '/housing/validateformAction';
    var data = {};
    data = $('#addhousing').serialize();

    //alert(data);
    
    //$("input").each(function(){
    //      data[$(this).attr('name')] = $(this).val();
    //});


    $.post(url,data,function(resp)
        {
        //document.write(resp);

                    console.log(resp);
                    alert(resp);
                    //parent.$.fancybox.close();



        },"json");
 
}

$(document).ready(function()
{	
	StepHousing(1);
});
function StepHousing(n){
	var container = $('#add_housing_fom');
	//container.empty();
	
	jQuery.ajax({
			type: "GET",
			url: '/housing/step'+n,
			data: {},
			beforeSend: function(){ 
					container.empty();
					container.append("<img src='/public/images/i3.gif' width='220px' height='19px' border='0' />");
			},
			success: function(html){ 
				container.empty();
				container.append(html);
			}
		});

}
function add_housing_form(step){
	StepHousing(step);
	
}
function empty(mixed_var){
	return ( mixed_var === "" || mixed_var === 0   || mixed_var === "0" || mixed_var === null  || mixed_var === false  || mixed_var === "undefined"  ||  ( is_array(mixed_var) && mixed_var.length === 0 ) );
}
